package com.shycloud.mido.member.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shycloud.mido.member.api.entity.BasicComboGoods;
import com.shycloud.mido.member.api.entity.BasicComboInfo;
import com.shycloud.mido.member.api.entity.BasicGoodsCategory;
import com.shycloud.mido.member.api.entity.BasicGoodsInfo;
import com.shycloud.mido.member.api.entity.HardwareSale;
import com.shycloud.mido.member.api.entity.PersonalCombVO;
import com.shycloud.mido.member.api.vo.BasicGoodsInfoVO;
import com.shycloud.mido.member.api.vo.GoodsInfoVO;
import com.shycloud.mido.member.api.vo.MallCreateOrderVO;
import com.shycloud.mido.member.api.vo.MemberOrderVO;
import com.shycloud.mido.member.api.vo.ProductsComboVO;

/**
 * @author Xiaoxing Yu
 * @date 2020/9/1
 **/
public interface ShoppingMallService extends IService<BasicComboInfo> {

	/**
	 * 新建一个虚拟产品套餐
	 *
	 * @param comboVO 套餐VO
	 * @return
	 */
	Boolean addNewCombo(ProductsComboVO comboVO);

	/**
	 * 编辑虚拟产品套餐
	 *
	 * @param comboVO 套餐VO
	 * @return
	 */
	Boolean editCombo(ProductsComboVO comboVO);

	/**
	 * 启用/禁用套餐
	 *
	 * @param comboVO
	 * @return
	 */
	Boolean triggerCombo(ProductsComboVO comboVO);

	/**
	 * 删除套餐
	 *
	 * @param comboId
	 * @return
	 */
	Boolean deleteCombo(Integer comboId);

	/**
	 * 新建一个虚拟产品套餐
	 *
	 * @param comboVO 套餐VO
	 * @return
	 */
	Boolean addPersonalCombo(PersonalCombVO comboVO);

	List<PersonalCombVO> getPersonalCombo(Integer optId);

	/**
	 * 获取所有套餐列表
	 *
	 * @return
	 */
	List<ProductsComboVO> getAllComboList(boolean onlyActive);

	/**
	 * 创建后台商城购买订单
	 *
	 * @return
	 */
	Map createOrder(MallCreateOrderVO orderVO, HttpServletRequest request);

	/**
	 * 删除后台商城购买订单
	 *
	 * @param orderNo
	 * @return
	 */
	Boolean deleteOrder(Long orderNo);

	/**
	 * 分页查询后台购买订单
	 *
	 * @return
	 */
	IPage<MemberOrderVO> pageOrders(Page page, String startDate,
									String endDate, String paymentMethod,
									String orderNo, String status,
									Integer optId, Integer orgId);


	/**
	 * 获取所有套餐列表
	 *
	 * @return
	 */
	List<BasicGoodsInfo> getGoods(Integer categoryId, String goodsName);


	Boolean editGoods(GoodsInfoVO goodsInfoVO);

	List<GoodsInfoVO> getEditableGoods();

	Map getVirtualGoods();

	Boolean editVirtualGoods(Map map);
	//calOnlineCoursePrice
	//calMasterPrice

	BigDecimal calOnlineCoursePrice(Integer duration);

	BigDecimal calMasterPrice(Integer duration);

	List<BasicGoodsInfo> getMasterGoods();

	List<BasicGoodsCategory> getGoodsCategory();

	BasicGoodsInfo getPriceByGoodsId(Integer goodsId);

	/**
	 * 添加商品
	 *
	 * @param goodsInfoVO
	 * @return java.lang.Boolean
	 * @author nianhua.jiang
	 * @date 2020/9/24 10:42
	 **/
	Boolean addGoods(BasicGoodsInfoVO goodsInfoVO);

	List<BasicComboGoods> getGoodsByCombo(Integer comboId);

	List<BasicGoodsInfo> matchGoodsInfoByKeyword(String keyword);

	Map<String, String> queryOrderPayment(String paymentMethod, String orderNo);

	/**
	 * 添加新套餐(H5页面用) 后台管理 -> 商品管理 -> 硬件销售项目 -> 新增项目
	 *
	 * @param entity
	 * @return java.lang.Boolean
	 * @author nianhua.jiang
	 * @date 2020/11/17 10:21
	 **/
	Boolean addNewComboByH5(HardwareSale entity);
}
